package conf

import (
	"Alpaca/log"
	"encoding/json"
	"os"
)

var Server struct {
	LogLevel     string
	LogPath      string
	MaxConn      int
	MaxMsgLen    uint32
	WriteChanLen int
	TcpAddr      string
	ConsolePort  int
}

func init() {
	data, err := os.ReadFile("/home/alpaca/go-learning/goproject/bin/conf/server.json")
	if err != nil {
		log.Fatal("%v", err)
	}
	err = json.Unmarshal(data, &Server)
	if err != nil {
		log.Fatal("%v", err)
	}
}
